<?php

/*
 * File name : ReviewAgency.php
 * Description : Allows Donor to review the details for the selected Agency
 * Created By : Pratibha Awasthi
 */

include_once "basePage.php";

class ReviewAgency extends basePage{

        public function display_information(){

        	 	session_start();
        		$payment = $_SESSION['payment_made'];
        		
        		
        		
        		if($payment == "false"){
        			$agency_search = $_POST['agency_search'];
        			$_SESSION['agency_search'] = $_POST['agency_search'];
        		}
        		else
        			$agency_search = $_SESSION['agency_search'];
        		
        		
                $con = mysql_connect('localhost','pa_user','secret_password');
                        if (!$con){
                                die('Could not connect: ' . mysql_error());
                        }
                  
                        mysql_select_db("TGS_GM_RESERVATION", $con);
            
                        //$result = mysql_query("SELECT * FROM TGS_GM_RESERVATION.tblagency WHERE ID = '{$_POST['agency_search']}'");
                        $result = mysql_query("SELECT * FROM TGS_GM_RESERVATION.tblagency WHERE ID = '{$agency_search}'");
                        $row = mysql_fetch_array($result);
                        
                        //var_dump($_POST['agency_search']);
                        //var_dump($row);
                        
                        echo <<<EAGENCY
						<script language=JavaScript>
						<!--
						
						//Disable right mouse click Script
						//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
						//For full source code, visit http://www.dynamicdrive.com
						
						var message="Function Disabled!";
						
						///////////////////////////////////
						function clickIE4(){
						if (event.button==2){
						alert(message);
						return false;
						}
						}
						
						function clickNS4(e){
						if (document.layers||document.getElementById&&!document.all){
						if (e.which==2||e.which==3){
						alert(message);
						return false;
						}
						}
						}
						
						if (document.layers){
						document.captureEvents(Event.MOUSEDOWN);
						document.onmousedown=clickNS4;
						}
						else if (document.all&&!document.getElementById){
						document.onmousedown=clickIE4;
						}
						
						document.oncontextmenu=new Function("alert(message);return false")
						
						// --> 
						</script>      
						
						<script type="text/javascript">
						
						/***********************************************
						* Disable Text Selection script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
						* This notice MUST stay intact for legal use
						* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
						***********************************************/
						
						function disableSelection(target){
						if (typeof target.onselectstart!="undefined") //IE route
							target.onselectstart=function(){return false}
						else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
							target.style.MozUserSelect="none"
						else //All other route (ie: Opera)
							target.onmousedown=function(){return false}
						target.style.cursor = "default"
						}
						
						//Sample usages
						disableSelection(document.body) //Disable text selection on entire body
						//disableSelection(document.getElementById("mydiv")) //Disable text selection on element with id="mydiv"
						
						</script>

                		<div id = "review">
                        <h1> Review Agency </h1>
                        <form action = "Payment.php" method = "post" name = "agency_review_page">
                        		
                        		<table id = "reviewAgency" >
                                <tr><td class ="reviewAgencyCat"><p><h3> Agency Name : </td><td></h3> {$row['Name']}</p></tr>
                                <tr><td class ="reviewAgencyCat"><p><h3> Agency Address : </td><td></h3> {$row['AddressNo']}, {$row['AddressStreet']} {$row['AddressStreetType']}, {$row['AddressLine2']} </br> {$row['City']}, {$row['State']} - {$row['Zip']}</br></p></tr>
                                <tr><td class ="reviewAgencyCat"><p><h3> Contact : </td><td></h3>Primary Phone : {$row['Phone']}</br></t>Secondary Phone : {$row['AddtnlPhone']}</br></t>Fax : {$row['Fax']}</p></tr>
                                <tr><td class ="reviewAgencyCat"><p><h3> Financial Details : </td><td></h3> </p></tr>
                                <tr><td class ="reviewAgencyCat"><p><h3> Board Summary : </td><td></h3>Board Title : {$row['BoardTitle']}</br></t> Board Name : {$row['BoardFirstName']} {$row['BoardLastName']}</tr>
                                   	<tr><td class ="reviewAgencyCat"><h3> Board Contact : </td><td></h3>Primary Phone : {$row['BoardPhone']}</br></t>Secondary Phone : {$row['BoardCell']}</br></t>Pager : {$row['BoardPager']}</br></t>Email : {$row['BoardEmail']}</p></tr>
                                <tr><td class ="reviewAgencyCat"><p><h3> Mission Statement : </td><td></h3> {$row['MissionStatement']} </p></tr>
                                <tr><td class ="reviewAgencyCat"><p><h3> Programs : </td><td></h3> {$row['TypeOfServices']} </p></tr>
                                <tr><td class ="reviewAgencyCat"><p><h3> Executive Information : </td><td></h3> </p></tr>
                                </table><br/><br/>
EAGENCY;
					   if($payment == "false"){
                       		echo "<br/> <input type = 'submit' name = 'submit' value = 'Download Agency Information'>";
					   }                       		
                        
                       echo <<<EAGENCY
						</form>
						</div>
						
EAGENCY;
					
                       mysql_close($con);
                        
                        
        }
}

$page = new ReviewAgency();
$page->header();
$page->top_menu_donor();
$page->display_information();
$page->footer();

?>
